home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #include "sw.h"
- #include "extern.h"
- #include "display.h"
- #include "control.h"
- #include "resources.h"
- #include <Xm/Form.h>
-
- Display* display;
- Widget mainWindow;
- SoXtRenderArea* view;
-
- Widget makeDisplay(const char* title)
- {
- mainWindow = SoXt::init(title,"Spacewar"); // make main window
- display = SoXt::getDisplay(); // get the X display
- setFallbacks(SoXt::getAppContext()); // set fallback resources
- loadResources(mainWindow); // get other resources
-
- // make form for main window
- Widget wf = XmCreateForm(mainWindow, "", NULL, 0);
-
- view = new SoXtRenderArea; // make view screen
- view->setSize(SbVec2s(GAMEWIDTH, short(GAMEWIDTH/ASPECT)));
- view->build(wf);
-
- Widget panel = makeControlPanel(wf); // make control panel
-
- // set sizes and attachments for view screen and control panel
- XtVaSetValues(panel,
- XmNbottomAttachment, XmATTACH_FORM,
- XmNleftAttachment, XmATTACH_FORM,
- XmNrightAttachment, XmATTACH_FORM,
- XmNheight, PANELHEIGHT,
- NULL);
- XtVaSetValues(view->getWidget(),
- XmNtopAttachment, XmATTACH_FORM,
- XmNbottomAttachment, XmATTACH_WIDGET,
- XmNleftAttachment, XmATTACH_FORM,
- XmNrightAttachment, XmATTACH_FORM,
- XmNbottomWidget, panel,
- XmNleftWidget, panel,
- XmNrightWidget, panel,
- NULL);
-
- view->show();
- SoXt::show(panel);
- SoXt::show(wf);
-
- return mainWindow;
- }
-